package com.aliothservice.catfish.identity.data;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.HashMap;
import java.util.Map;

import org.springframework.data.annotation.Id;

public class WithdrawRequest {
	
	public Map<String, Object> toMap() {
		Map<String, Object> map = new HashMap<String, Object>();
		
		map.put("id", this.getId());
		map.put("userId", this.getUserId());
		map.put("alipayAccount", this.getAlipayAccount());
		map.put("alipayUserName", this.getAlipayUserName());
		map.put("withdrawAmount", this.getWithdrawAmount());
		map.put("processUrl", this.getProcessUrl());
		DateTimeFormatter fullFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss:SSS");
		map.put("creationDate", fullFormatter.format(this.getCreationDate()));
		
		return map;
	}
	
	public static final String STATUS_REQUESTED = "requested";
	public static final String STATUS_ACCEPTED = "accepted";
	public static final String STATUS_REJECTED = "rejected";
	public static final String STATUS_PROCESSING = "processing";
	public static final String STATUS_PENDING = "pending";
	public static final String STATUS_PROCESSED = "processed";
	
	@Id
	private String id;
	
	// who made this request
	private String userId;
	
	private String alipayAccount;
	private String alipayUserName;
	private Float withdrawAmount;
	
	private LocalDateTime creationDate;
	
	private String processUrl;
	
	private String descriptionOfReject;
	
	private String status;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public LocalDateTime getCreationDate() {
		return creationDate;
	}

	public void setCreationDate(LocalDateTime creationDate) {
		this.creationDate = creationDate;
	}

	public String getAlipayAccount() {
		return alipayAccount;
	}

	public void setAlipayAccount(String alipayAccount) {
		this.alipayAccount = alipayAccount;
	}

	public String getAlipayUserName() {
		return alipayUserName;
	}

	public void setAlipayUserName(String alipayUserName) {
		this.alipayUserName = alipayUserName;
	}

	public Float getWithdrawAmount() {
		return withdrawAmount;
	}

	public void setWithdrawAmount(Float withdrawAmount) {
		this.withdrawAmount = withdrawAmount;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getProcessUrl() {
		return processUrl;
	}

	public void setProcessUrl(String processUrl) {
		this.processUrl = processUrl;
	}

	public String getDescriptionOfReject() {
		return descriptionOfReject;
	}

	public void setDescriptionOfReject(String descriptionOfReject) {
		this.descriptionOfReject = descriptionOfReject;
	}

}
